home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 201-225 / disk_222 / plplot / src / source.zoo / stindex.c < prev    next >
C/C++ Source or Header  |  1989-05-15  |  431b  |  20 lines

  1. #include "plplot.h"
  2.  
  3. int stindex(str1,str2)
  4. char *str1,*str2;
  5. {
  6.     int base;
  7.     int str1ind;
  8.     int str2ind;
  9.  
  10.     for(base=0; *(str1+base)!='\0'; base++) {
  11.         for(str1ind=base, str2ind=0; *(str2+str2ind)!='\0' &&
  12.             *(str2+str2ind) == *(str1+str1ind); str1ind++, str2ind++)
  13.             ;   /* no body */
  14.  
  15.         if(*(str2+str2ind) == '\0')
  16.             return(base);
  17.     }
  18.     return(-1);    /* search failed */
  19. }
  20.